<template>
	<div class="flex">
		<div v-for="(item, index) in getRecommendTodayMenuList" :key="index" class="box">
			<h1>{{ item.title }}</h1>
			<div class="w_RecommendToday">
				<ul>
					<li v-for="(item, index) in item.data" :key="index" @click="JumpFoodsDetail(item)">
						<img class="Collection_img" :src="getImages(item.smallImg)" alt="" />
						<p>{{ item.cpName }}</p>
					</li>
				</ul>
			</div>
		</div>
	</div>
</template>

<script>
import { getRecommendTodayMenuList } from '@/api/menu';
export default {
	name: 'FoodsCollection',
	data() {
		return {
			getRecommendTodayMenuList: [], // 今日推荐菜谱列表
		};
	},
	async created() {
		this.getRecommendTodayMenuList = await getRecommendTodayMenuList();
	},
};
</script>

<style scoped>
.flex {
	display: flex;
	width: 100%;
	flex-direction: column;
	margin-top: 30px;
}
.flex h1 {
	height: 40px;
	color: #3c454b;
	font-family: Noto Sans SC;
	font-size: 20px;
	font-weight: 500;
	line-height: 30px;
	letter-spacing: 0px;
	text-align: left;
	padding-left: 15px;
}
.box {
	margin-bottom: 20px;
}
.w_RecommendToday {
	width: 100%;
	box-sizing: border-box;
	overflow-y: hidden;
	border-color: #ffd719;
}
.w:first-child {
	margin-left: 15px;
}
ul {
	line-height: 30px;
	white-space: nowrap;
	overflow-x: auto;
	padding: 0 10px 0 5px;
}
ul::-webkit-scrollbar {
	display: none;
}
ul > li {
	display: inline-block;
	padding: 0 0 0 10px;
	border-radius: 20px;
}
ul > li > p {
	width: 200px;
	color: #3c454b;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	line-height: 20px;
	font-weight: 700;
}
ul > li > .Collection_img {
	width: 200px;
	height: 130px;
	position: relative;
	border-radius: 10px;

	background-size: cover;
	background-position: center;
}
</style>
